from django.db import models

# Create your models here.





class Tea(models.Model):
    tname=models.CharField(verbose_name='姓名',max_length=100)
    tclass=models.CharField(max_length=100,verbose_name='学科')
    evaluate=models.CharField(max_length=400,verbose_name='评价')
    class Meta:
        db_table = 'z-tea'
    def __str__(self):
        return self.tname



class Stu(models.Model):
    sname = models.CharField(verbose_name='姓名',max_length=100)
    sage = models.IntegerField(verbose_name='年龄')
    score = models.FloatField(verbose_name='分数')
    sid=models.ForeignKey(Tea,on_delete=models.CASCADE,related_name='stu',null=True)
    class Meta:
        db_table = 'z-stu'
    def __str__(self):
        return self.sname